Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't change directory to tmp dir #79

Merged
merged 2 commits into from
Nov 9, 2023
Merged

Don't change directory to tmp dir #79

merged 2 commits into from
Nov 9, 2023

Conversation

ahamez
Copy link
Contributor

@ahamez ahamez commented Dec 9, 2021

When deploying an application to Kubernetes, it's a good practice to configure the filesystem as read only, for security reasons (the filesystem can still be modified outside the container, for instance Vault can automatically rotate credentials which are mounted in the application container).

However, file_system uses the function System.tmp_dir!() which fails when the file system is read only:

** (RuntimeError) could not get a writable temporary directory, please set the TMPDIR environment variable
    (elixir 1.13.0) lib/system.ex:388: System.tmp_dir!/0

Thus, this PR simply removes the call to System.tmp_dir!().

I'm not 100% that removing this call won't be a problem, but on the other hand, I don't see why a temporary writable directory is useful to interact with inotifywait via Port. Furthermore, my tests shown no problems when removing the directory change.

@josevalim
Copy link
Contributor

This looks good to go to me!

@falood falood merged commit 2b4a530 into falood:main Nov 9, 2023
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants